package cn.ljy.authority.web.controller.backstage.system.sms;


import cn.ljy.authority.model.SysPhoneVerificationCode;
import cn.ljy.authority.model.query.SysPhoneVerificationCodeQuery;
import cn.ljy.authority.service.SysDictService;
import cn.ljy.authority.web.controller.backstage.BaseBackstageController;
import cn.ljy.common.exception.model.MyUnAuthorizedException;
import cn.ljy.common.model.result.ResponseData;
import cn.ljy.common.model.validate.AddWorkValidation;
import cn.ljy.common.model.validate.UpdateWorkValidation;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotEmpty;

@Api(tags = "后台手机短信日志管理管理模块")
@RestController
@RequestMapping(value = "/backstage/system/phoneVerificationCode")
public class SysPhoneVerificationCodeController extends BaseBackstageController<SysPhoneVerificationCode, SysPhoneVerificationCodeQuery, Long> {

    @Autowired
    private SysDictService sysDictService;

    @Override
    protected String getAuthorityPrefix() {
        return null;
//        return "sys:phoneVerificationCode"; // 定义模块权限前缀
    }

    @Override
    public ResponseData add(@Validated({AddWorkValidation.class}) @RequestBody SysPhoneVerificationCode t) {
        throw new MyUnAuthorizedException("不允许操作添加接口");
    }

    @Override
    public ResponseData edit(@Validated({UpdateWorkValidation.class}) @RequestBody SysPhoneVerificationCode t) {
        throw new MyUnAuthorizedException("不允许操作编辑接口");
    }

    @Override
    protected ResponseData deletes(@NotEmpty(message = "请选择要移除的记录") Long[] ids) {
        throw new MyUnAuthorizedException("不允许操作删除接口");
    }

    @Override
    protected ResponseData forceDeletes(@NotEmpty(message = "请选择要移除的记录") Long[] ids) {
        throw new MyUnAuthorizedException("不允许操作强制删除接口");
    }
}
